package com.test;

public class Hero extends Tank{
	
    
	public Hero(int x,int y){
		super(x,y);
		this.setSpeed(4);
		this.setColor(1);
		
	}
	
	//Tir
	public void tirer()
	{
		
		
		switch(this.getDirect())
		{
		case 0:
			m = new Munition(this.getX()-1,this.getY()-14,0);
			mm.add(m);
			break;
		case 1:
			m = new Munition(this.getX()-1,this.getY()+11,1);
			mm.add(m);
			break;
		case 2:
			m = new Munition(this.getX()-14,this.getY()-1,2);
			mm.add(m);
			break;
		case 3:
			m = new Munition(this.getX()+11,this.getY()-1,3);
			mm.add(m);
			break;
		}
		
		Thread t=new Thread(m);
		t.start();
		
	}
	
	public void moveUp()
	{
		this.y -= speed;
	}
	public void moveRight()
	{
		this.x += speed;
	}
	public void moveDown()
	{
		this.y += speed;
	}
	public void moveLeft()
	{
		this.x -= speed;
	}
}
